<template>
    <div class="goods">
<detail-header></detail-header>
<detail-lunbo :lunbo="lunbo"></detail-lunbo>
<detail-product :product="product"></detail-product>
<detail-address :address="address"></detail-address>
    </div>
    <detail-footer></detail-footer>
</template>

<script>
import { getDetailPro } from '@/apis/home';
import DetailHeader from './components/DetailHeader.vue';
import DetailLunbo from './components/DetailLunbo.vue';
import DetailProduct from './components/DetailProduct.vue';
import DetailAddress from './components/DetailAddress.vue';
import DetailFooter from './components/DetailFooter.vue';
    export default {
        data(){
            return{
                lunbo:[],
                product:[],
                address:''

            }
        },
        components:{
            DetailHeader,
            DetailLunbo,
            DetailProduct,
            DetailAddress,
            DetailFooter,

        },
        created(){
            console.log(this.$route.params.proid);
            
            getDetailPro(this.$route.params.proid).then(res=>{
                console.log(res.data.data);
                this.lunbo = res.data.data.banners[0].split(",")
                this.product=res.data.data
                // 假设接口返回的地址信息在res.data.data.address中，如果结构不同需要根据实际情况调整
                this.address = res.data.data.address || '';
            })
        }
    }
    
</script>

<style lang="less" scoped>

</style>